<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWorkerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('worker', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('shop_id')->default('0')->comment('店铺ID');
            $table->integer('user_id')->default('0')->comment('用户ID');
            $table->string('image')->nullable()->comment('图片');
            $table->string('name')->default('')->comment('名称');
            $table->string('phone')->default('')->comment('电话');
            $table->decimal('money')->default('0.00')->comment('可提现余额');
            $table->decimal('used_money')->default('0.00')->comment('已提现余额');
            $table->integer('province_id')->default(0)->comment('省ID');
            $table->integer('city_id')->default(0)->comment('市ID');
            $table->integer('district_id')->default(0)->comment('区ID');
            $table->string('area')->nullable()->comment('所在区域');
            $table->tinyInteger('status')->default('0')->comment('状态:0=正常,1=隐藏');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('worker');
    }
}
